import { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  // 后台首页
  {
    path: '',
    name: 'AHome',
    meta: {
      title: '首页'
    },
    component: () => import('../../views/admin/Home.vue')
  },
  // 公益作用
  {
    path: 'review',
    name: 'AReview',
    meta: {
      title: '公益作用'
    },
    component: () => import('../../views/admin/Review.vue')
  },
  // 新闻资讯
  {
    path: 'news',
    name: 'ANews',
    meta: {
      title: '新闻资讯'
    },
    component: () => import('../../views/admin/News.vue')
  },
  // 预约记录
  {
    path: 'appointment',
    name: 'AAppointment',
    meta: {
      title: '预约记录'
    },
    component: () => import('../../views/admin/Appointment.vue')
  },
  // 公益事项
  {
    path: 'matters',
    name: 'AMatters',
    meta: {
      title: '公益事项'
    },
    component: () => import('../../views/admin/Matters.vue')
  },
  // 公益记录
  {
    path: 'record',
    name: 'ARecord',
    meta: {
      title: '公益记录'
    },
    component: () => import('../../views/admin/Record.vue')
  },
  // 活动历程
  {
    path: 'course',
    name: 'ACourse',
    meta: {
      title: '活动历程'
    },
    component: () => import('../../views/admin/Course.vue')
  },
  // 管理员
  {
    path: 'admintor',
    name: 'AAdmintor',
    meta: {
      title: '管理员'
    },
    component: () => import('../../views/admin/Transfer.vue'),
    children: [
      {
        path: 'add',
        name: 'AAdd',
        meta: {
          title: '添加管理员'
        },
        component: () => import('../../views/admin/admintor/Add.vue')
      },
      {
        path: 'manage',
        name: 'AManage',
        meta: {
          title: '管理员管理'
        },
        component: () => import('../../views/admin/admintor/Manage.vue')
      }
    ]
  },
  // 日志
  {
    path: 'logs',
    name: 'ALogs',
    meta: {
      title: '日志'
    },
    component: () => import('../../views/admin/Transfer.vue'),
    children: [
      {
        path: 'login',
        name: 'ALogin',
        meta: {
          title: '登录日志'
        },
        component: () => import('../../views/admin/logs/LoginLogs.vue')
      },
      {
        path: 'operation',
        name: 'AOperation',
        meta: {
          title: '操作日志'
        },
        component: () => import('../../views/admin/logs/Operation.vue')
      },
      {
        path: 'error',
        name: 'AError',
        meta: {
          title: '错误日志'
        },
        component: () => import('../../views/admin/logs/ErrorsLogs.vue')
      }
    ]
  },
  // 个人中心
  {
    path: 'personal',
    name: 'APersonal ',
    meta: {
      title: '个人中心'
    },
    component: () => import('../../views/admin/UserInfo.vue')
  },
  // 我的消息
  {
    path: 'message',
    name: 'AMessage ',
    meta: {
      title: '我的消息'
    },
    component: () => import('../../views/admin/Message.vue'),
    children: [
      // 重定向
      {
        path: '',
        redirect: '/admin/message/system'
      },
      // 系统消息
      {
        path: 'system',
        name: 'ASysten',
        meta: {
          title: '系统消息'
        },
        component: () => import('@/views/admin/message/SystemMes.vue')
      },
      // 节日祝福
      {
        path: 'festival',
        name: 'Afestival',
        meta: {
          title: '节日祝福'
        },
        component: () => import('@/views/admin/message/FestivalMes.vue')
      },
      // 用户预约
      {
        path: 'order',
        name: 'AOrder',
        meta: {
          title: '用户预约'
        },
        component: () => import('@/views/admin/message/OrderMes.vue')
      },
      // 星标信息
      {
        path: 'start',
        name: 'AStart',
        meta: {
          title: '星标信息'
        },
        component: () => import('@/views/admin/message/StartMes.vue')
      }
    ]
  },
  // 修改密码
  {
    path: 'altPass',
    name: 'AAltPass',
    meta: {
      title: '修改密码'
    },
    component: () => import('../../views/admin/AltPass.vue')
  },
  // 修改文章
  {
    path: 'article/:id',
    name: 'AArticle',
    meta: {
      title: '修改文章'
    },
    component: () => import('../../views/admin/Article.vue')
  },
  // 发表文章
  {
    path: 'create',
    name: 'ACreate',
    meta: {
      title: '发表文章'
    },
    component: () => import('../../views/admin/Article.vue')
  }
]

export default routes
